package com.nmh.dto;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author lzx
 * @since 2023-12-19
 */
@Getter
@Setter
//@TableName("pasture")
public class PastureDto implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "pasture_id", type = IdType.AUTO)
    private Integer pastureId;
    /**
     * 牧场名称
     */
    @TableField("pasture_name")
    @NotEmpty
    @Length(min=1,max=100,message = "牧场名字最大为长度为100")
    private String pastureName;
    /**
     * 场地规模
     */
    @NotNull
    @TableField("site_size")
    @Max(999999)
    @Min(100)
    @Digits(integer =6,fraction = 3)
    private Integer siteSize;
    /**
     * 养殖规模
     */
    @NotNull
    @TableField("cultivation_size")
    @Max(999999)
    @Min(1)
    @Digits(integer =6,fraction = 1,message = "养殖规模大于6位数")
    private Integer cultivationSize;
    /**
     * 地址
     */
    @NotEmpty
    @TableField("address")
    private String address;
    /**
     * 经纬度位置
     */
    @NotEmpty
    @TableField("latitude")
    private String latitude;
    @NotEmpty
    @TableField("longitude")
    private String longitude;
    /**
     * 牲畜id
     */
//    @NotNull
    @TableField("livestock_id")
    private Integer livestockId;
    /**
     * 0启用，1停止
     */
    @TableField("states")
    private Integer states;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "牧场创建时间")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "牧场修改时间")
    private LocalDateTime updateTime;
}
